<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>

  <div class="container-fluid ms-container has-ms-sidemenu">

    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">牵引车信息审核</li>
    </ol>
    
    <div class="ms-content-layout">

      <ul class="nav nav-tabs ms-nav-tabs" role="tablist">
        <li role="presentation" class="${declareStatus.unsync ? 'active' : ''}">
          <a href="${ctx.host}/tractor-audits?declareStatus=UNSYNC">引入审核</a>
        </li>
        <li role="presentation" class="${declareStatus.modified ? 'active' : ''}">
          <a href="${ctx.host}/tractor-audits?declareStatus=MODIFIED">变更审核</a>
        </li>
      </ul>

      <div class="ms-operation-bar no-margin no-bottom-border clearfix">

        <div class="ms-operation-group">
          <div class="pull-right">
            <a href="${ctx.host}/tractor-audits/search?declareStatus=${declareStatus}" data-target="#search" data-toggle="modal" class="btn ms-btn ms-btn-blue"> 
              <i class="glyphicon"></i>&nbsp;&nbsp;过滤查询
            </a>
          </div>
        </div>
      </div>

      <table class="table table-hover ms-table">
        <thead>
          <tr>
            <th>序号</th>
            <th>牵引车中文车牌号</th>
            <th>牵引车英文车牌号</th>
            <th>运输工具类型</th>
            <th>所属公司</th>
            <th>所属供方</th>
            <th class="text-center">操作</th>
          </tr>
        </thead>

        <tbody>
          <c:forEach var="tractor" items="${tractors}" varStatus="item">
            <tr>
              <td>${item.count}</td>
              <td>${tractor.brandCNCode}</td>
              <td>${tractor.brandENCode}</td>
              <td>${tractor.transMean.description}</td>
              <td>${tractor.organization.name}</td>
              <td>${tractor.supplier.name}</td>
              <td class="text-center">
                
                <c:choose>
                  <c:when test="${declareStatus.unsync}">
                    <a href="${ctx.host}/tractors/${tractor.id}?tractorMenuType=editing">详情</a>&nbsp;&nbsp;
                  </c:when>
                  <c:otherwise>
                    <a href="${ctx.host}/tractor-audits/${tractor.id}?declareStatus=MODIFIED">详情</a>&nbsp;&nbsp;
                  </c:otherwise>
                </c:choose>
                
                <a href="${ctx.host}/tractor-audits/${tractor.id}/adopt?declareStatus=${declareStatus}" data-target="#adopt" data-toggle="modal">通过</a>&nbsp;&nbsp;
                <a href="${ctx.host}/tractor-audits/${tractor.id}/reject?declareStatus=${declareStatus}" data-target="#reject" data-toggle="modal">驳回</a>
                
              </td>
            </tr>
          </c:forEach>
        </tbody>

        <tfoot>
          <tr>
            <td colspan="9" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="tractor-audits" />
                  <jsp:param name="queryString" value="${queryString}" />
                </jsp:include>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>
    </div>

  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/flow/tractor-audit-list.js"/>
  <script type="text/javascript">
    require(['page/supplier/flow/tractor-audit-list'], function (page) {
      page.init()
    })
  </script>

</body>
</html>